package cn.sc.summer.protocol.form.user;

import cn.sc.summer.constant.regex.RegexConstant;
import cn.sc.summer.protocol.ValidatedGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 类名：用户修改密码提交表单信息
 *
 * @author a-xin
 * @date 2023/12/11 09:49
 */
@Data
@Accessors(chain = true)
@ApiModel("用户修改密码提交表单信息")
public class UserChangePasswordForm implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空！", groups = ValidatedGroup.FORGET_PASSWORD.class)
    @Pattern(regexp = RegexConstant.TEL_REGEX, message = "手机号格式不正确！", groups = ValidatedGroup.FORGET_PASSWORD.class)
    private String phone;

    /**
     * 新密码
     */
    @ApiModelProperty(value = "新密码")
    @NotBlank(message = "新密码不能为空！")
    @Pattern(regexp = RegexConstant.PASSWORD_STRONG_REGEX, message = "密码不规范,必须包含:大小写字母，数字，特殊符号，且长度在10-20位!")
    private String newPassword1;

    /**
     * 确认密码
     */
    @ApiModelProperty(value = "确认密码")
    @NotBlank(message = "确认密码不能为空！")
    @Pattern(regexp = RegexConstant.PASSWORD_STRONG_REGEX, message = "密码不规范,必须包含:大小写字母，数字，特殊符号，且长度在10-20位!")
    private String newPassword2;

}
